<%-- 
    Document   : Chat
    Created on : 08 Apr 11, 10:17:00
    Author     : Archie
--%>

<%@page import="java.sql.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:useBean id="users" class="Session.SessionKeeper" scope="session"></jsp:useBean>
<% users.setUsername(request.getParameter("Username"));%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Chatroom</title>
        <link rel="stylesheet" href="CSS/MenuStyle.css" type="text/css" />

        <script type="text/javascript" src="javascript/chatmanage.js"></script>
        <script type="text/javascript" src="javascript/PageRefresh.js"></script>
    </head>
    <body onload="ajaxOnlineFriend('<%= request.getParameter("Username")%>');listRoomDibuka('<%= request.getParameter("Username")%>');ajaxOfflineFriend('<%= request.getParameter("Username")%>');chatdibuka('<%= request.getParameter("Username")%>');showRoomUser();">
        <div id="sidebar">
            <h1>Chit-Chat</h1>
            <h2>Tubes 4 Progin</h2>
            <p>
                Created by :<br /><br />
                Archie Anugrah - 13508001<br />
                Darwin Soesanto - 13508102<br />
                Listiarso Wastuargo - 13508103<br />
            </p>

            <div id="menu">
                <a class="active" href="#">ChatRoom</a>
                <a onclick="openWindow();" href="#">Add Room</a>
                <a href="javascript:ajaxCategory();">Trial Only</a>
                <a href="Logout.jsp">Logout</a>
            </div>
        </div>

       <div id="chatsidebar">
            <div id="chatlist">
                <!--<p id="Jenislist">Category</p>
                <a href="#">Sport</a>
                <a href="#">Music</a>
                <a href="#">Art</a>
                <a href="#">Sport</a>
                <a href="#">Music</a>
                <a href="#">Art</a>
                <a href="#">Sport</a>
                <a href="#">Music</a>
                <a href="#">Art</a>
                <a href="#">Sport</a>
                <a href="#">Music</a>
                <a href="#">Art</a>
                <a href="#">Sport</a>
                <a href="#">Music</a>
                <a href="#">Art</a>
                <a href="#">Sport</a>
                <a href="#">Music</a>
                <a href="#">Art</a>
                <a href="#">Sport</a>
                <a href="#">Music</a>
                <a href="#">Art</a>-->
            </div>
        </div>




        <div id="onlinesidebar">
            <div id="onlinelist">
                <div id="Button"><a href="javascript:hideOfflineFriend();">Hide/Show Offline</a></div>
                <p id="Jenislist">OnlineFriend</p>
                <div id ="listfriends">
                    
                </div>
            </div>
            <div id="offlinelist" style="visibility: hidden">
                <p id="Jenislist">OfflineFriend</p>
                <div id ="offlistfriends">

                </div>
            </div>
        </div>


        <div id="openedsidebar">
            <ul id="roomdibuka">
                <!--<li><a href="#" >Bands</a></li>
                <li><a href="#" >Artists</a></li>
                <li><a href="#" >Bands</a></li>
                <li><a href="#" >Artists</a></li>
                <li><a href="#" >Bands</a></li>
                <li><a href="#" >Artists</a></li>
                <li><a href="#" >Bands</a></li>
                <li><a href="#" >Artists</a></li>-->
            </ul>
        </div>



        <div id="content">
            <div id="isiChatting">
            <!--<p><a>Darwin</a>Hai semua</p>
            <p><a>Gogo</a>Hai juga ganteeeeng :*</p>
            <p><a>Archie</a>Homo -.-"</p>
            <p><a>Darwin</a>Hai semua</p>
            <p><a>Gogo</a>Hai juga ganteeeeng :*</p>
            <p><a>Archie</a>Homo -.-"</p>
            <p><a>Darwin</a>Hai semua</p>
            <p><a>Gogo</a>Hai juga ganteeeeng :*</p>
            <p><a>Archie</a>Homo -.-"</p>
            <p><a>Darwin</a>Hai semua</p>
            <p><a>Gogo</a>Hai juga ganteeeeng :*</p>
            <p><a>Archie</a>Homo -.-"</p>
            <p><a>Darwin</a>Hai semua</p>
            <p><a>Gogo</a>Hai juga ganteeeeng :*</p>
            <p><a>Archie</a>Homo -.-"</p>
            <p><a>Darwin</a>Hai semua</p>
            <p><a>Gogo</a>Hai juga ganteeeeng :*</p>
            <p><a>Archie</a>Homo -.-"</p>-->
            </div>

            <div id="chatinput" style="visibility: hidden">
                <input type="text" id="isiSubmittedChat" size="83" value="" style="overflow: auto">
                <p></p>
                <input type="button" value="Close Room" onclick="keluardariRoom(getroomdibukasaatini(),document.getElementById('username').value);">
                <input type="button" value="Submit Chat" onclick="ajaxaddRoomUserMessage(getroomdibukasaatini(), document.getElementById('username').value, document.getElementById('isiSubmittedChat').value);ajaxshowisiRoomChat(getroomdibukasaatini())">
            </div>

            <input id="roomdibukasaatini" type="hidden" value="" >
            <%
                out.println("<input id='username' type='hidden' value='"+users.getUsername()+"' >");
                out.println("<input id='role' type='hidden' value='"+request.getParameter("Role")+"' >");
            %>
        </div>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
    function openWindow(){
        WREF = window.open("RoomSelection.jsp","RoomSelection",'width=550,height=650');
        if(!WREF.opener){ WREF.opener = this.window; }
    }
</script>
        

    </body>
</html>
